How would I perform an operation on each element in an array and add the new value to a new array in